CC = g++
DEBUG = -g
CFLAGS = -Wall `sdl-config --cflags` -I./ -I./../.. -I./../../linux -c $(DEBUG)
LFLAGS = -Wall $(DEBUG)
LIBS = `sdl-config --libs` -lm  -lSDL_image -lSDL_mixer -lpng -lGL -lGLU 

OBJECTS = main.o ../../linux/render.o ../../linux/input.o ../../sprite.o ../../utils.o ../../animation.o ../../collision.o ../../linux/audio.o ../../linux/timer.o ../../font.o

all: rm-elf $(OBJECTS)
	$(CC) $(LFLAGS) $(OBJECTS) -o testjoy $(LIBS)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -f *.o testjoy

rm-elf:
	-rm -f testjoy $(OBJECTS)
